package bdz.projects.inl.vo
{
	import bdz.projects.inl.core.CoreVO;

	public class NewsVO extends CoreVO
	{
		
		public var news_id:String;
		
		public var news_title:String;
		
		public var news_date:Date;
		
		
		public var news_body:String;
		
		public var news_excerpt:String;
		
		public var projects:Array = new Array();
		
		public var products:Array = new Array();
		
		
		public function NewsVO(def:XML = null) {
			idField = "news_id";
			linkPairs = [
						{tree:"projects", node:"inl_projects", arr:"projects", vo:ProjectVO},
						{tree:"products", node:"inl_products", arr:"products", vo:ProductVO}
						];	
			if(def && def.name() != "inl_news"){
				def = def.inl_news[0];	
			}
			propList = ["news_id", "news_title", "news_date", "news_body", "news_excerpt"];
			super(def, NewsMediaVO, "inl_news");
		}
		override protected function createPropertyAttributes():void{
			propAttributes = [
			{name:"news_title", type:"input", label:"Title"},
			{name:"news_date", type:"date", label:"Date"},
			{name:"news_body", type:"text", label:"Entry"},
			{name:"news_excerpt", type:"input", label:"Excerpt"},
			{name:"relations", type:"dependency_list", vo:NewsMediaVO, label:"Media", list:"media", labelField:"media_link"},
			{name:"projects", type:"dependency_list", vo:ProjectVO, label:"Projects", list:"link", labelField:"project_title"},
			{name:"products", type:"dependency_list", vo:ProductVO, label:"Products", list:"link", labelField:"product_name"}
			];
		}
		
	}
}